Skip to content

fix(desktop): prevent large diff timeline hangs#33122

Open
ZhongYanZhiShi wants to merge 1 commit into
anomalyco:devfrom
ZhongYanZhiShi:desktop-hang-fix
Open

fix(desktop): prevent large diff timeline hangs#33122
ZhongYanZhiShi wants to merge 1 commit into
anomalyco:devfrom
ZhongYanZhiShi:desktop-hang-fix

Conversation

@ZhongYanZhiShi

@ZhongYanZhiShi ZhongYanZhiShi commented Jun 20, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #33106

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Large session summaries can include thousands of unique file diffs. The timeline row builder was deduplicating those diffs by scanning the already collected result for each item, which turns that path quadratic and can block the desktop renderer.

This changes diff summary deduplication to a Set-backed reverse scan, preserving the existing behavior of showing the last diff for each file in original display order. It also makes desktop recovery logging safe when Electron has already destroyed a BrowserWindow or WebContents, so recovery logs do not throw Object has been destroyed.

How did you verify your code works?

  • bun test ./src/main/window-state.test.ts
  • git diff --check
  • bun turbo typecheck via the pre-push hook
  • Manually verified the desktop client starts normally with this change applied; stashing this commit reproduces the hang

Screenshots / recordings

Not a visual UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Jun 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop app hangs and crashes when rendering large session diff summary

1 participant